<?php

namespace App\Models;

use App\Enums\LotteryRecordStatus;
use BenSampo\Enum\Traits\CastsEnums;

/**
 * @mixin IdeHelperLotteryRecord
 */
class LotteryRecord extends BaseModel
{
    use CastsEnums;

    protected $casts = [
        'status' => LotteryRecordStatus::class,
    ];

    public function lottery()
    {
        return $this->belongsTo(Lottery::class, 'lottery_id');
    }

    public function award()
    {
        return $this->belongsTo(LotteryAward::class, 'award_id');
    }

    public function user()
    {
        return $this->belongsTo(FrontendUser::class, 'user_id');
    }
}
